/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pl.edu.agh.student.nn.core.cp;

import pl.edu.agh.student.nn.core.ActivationFunction;
import pl.edu.agh.student.nn.core.ActivationFunctionType;

/**
 * @author janburkot
 */
public class DeltaRuleTeaching implements Teaching {
    private ActivationFunction f;

    public ActivationFunction getF() {
        return f;
    }

    public void setF(ActivationFunction f) {
        this.f = f;
    }

    public double countNewWeight(double oldWeight, double learningRate, double expectedResult, double output, double input) {
        return oldWeight + learningRate * (expectedResult - output) * input * f.d(input);
    }
}
